package com.example.sinaweibo1.ui;

import java.util.HashMap;

import android.app.Activity;
import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.example.sinaweibo1.R;
import com.example.sinaweibo1.bean.Task;
import com.example.sinaweibo1.logic.MainService;

public class LoginActivity extends Activity implements IWeiboActivity {
	
	private Button loginButton;
	private TextView loginText;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_login);
//		loginButton = (Button) findViewById(R.id.login_button);
//		loginText = (TextView) findViewById(R.id.login_text);
//		loginButton.setOnClickListener(new OnClickListener() {
//			
//			@Override
//			public void onClick(View v) {
//				MainService.newTask(new Task(Task.WEIBO_LOGIN, new HashMap<String, Object>()));
//				MainService.addActivity(LoginActivity.this);
//				Log.i("laf", "loginbutton");
//			}
//		});
//		startService(new Intent(this, MainService.class));
		
		Intent intent = new Intent(this, AuthActivity.class);
		startActivity(intent);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.login, menu);
		return true;
	}

	@Override
	public void init() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void refresh(Object... params) {
		
		String str = (String) params[0];
		loginText.setText(str);
		
	}

}
